<!-- 设备管理-设备采购-推荐机构 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="机构名称">
              <el-input v-model="listQuery.fuser" placeholder="请输入编号或名称" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
              <!-- <el-button type="success" icon="el-icon-download">导出</el-button> -->
              <!-- <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button> -->
              <!-- <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button> -->
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FCATNO" label="机构编号"  ></el-table-column>
          <el-table-column prop="FCATNAME" label="机构名称" ></el-table-column>
          <el-table-column prop="FMEMO" label="所属区域" ></el-table-column>
          <el-table-column prop="FSEQ" label="排序" width="95"></el-table-column>
          <el-table-column prop="FBILLSTATE" label="状态" width="115"></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        customlist:[
          {
            "FBILLNO": "K241130001", 
            "FBILLCREDATE":"2024-11-30",
            "FUSER": "曹操",
            "FMEMO": "有机化学实验操作课",
            "FBEGDATE": "2024-12-01",
            "FENDDATE": "2025-11-30",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLSTATE": "申请中"
          },
        ],
        list: [
            {
            "FCATNO":"010908075460",
            "FCATNAME": "蓝湖营地教育冬令营",
            "FMEMO":"青浦区",
            "FSEQ": "1",
            "FBILLSTATE": "正常"
            },
            ,{
            "FCATNO":"010908075465",
            "FCATNAME": "‌上海研学教育中心",
            "FMEMO":"浦东区",
            "FSEQ": "3",
            "FBILLSTATE": "正常"
            },{
            "FCATNO":"034908075465",
            "FCATNAME": "上海科技研学基地",
            "FMEMO":"黄浦区",
            "FSEQ": "4",
            "FBILLSTATE": "正常"
            },{
            "FCATNO":"034998565460",
            "FCATNAME": "上海文化之旅研学机构",
            "FMEMO":"静安区",
            "FSEQ": "5",
            "FBILLSTATE": "正常"
            }
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>